<template>
  <view class="search-bar">
    <view class="search-icon-wrapper">
      <uni-icons type="search" size="24" color="#333" />
    </view>
    <input
      type="text"
      class="search-input"
      placeholder="搜索咨询师"
      v-model="searchQuery"
      @input="handleInput"
    />
  </view>
</template>

<script>
export default {
  data() {
    return {
      searchQuery: ''
    };
  },
  methods: {
    handleInput() {
      this.$emit('search', this.searchQuery);
    }
  }
};
</script>

<style scoped>
.search-bar {
  display: flex;
  align-items: center;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-icon-wrapper {
  margin-right: 8px;
  display: flex;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 0 10px;
  border: none;
  outline: none;
  background-color: transparent;
  font-size: 16px;
  color: #333;
}

.search-input::placeholder {
  color: #999;
}
</style>